from diffusers import DiffusionPipeline
import torch
import torch_npu
from torch_npu.contrib import transfer_to_npu


torch.npu.set_compile_mode(jit_compile=False)


generator = DiffusionPipeline.from_pretrained("anton-l/ddpm-butterflies-128")
generator.to("cuda")
image = generator().images[0]
image.save("generated_image.png")